﻿@model IEnumerable<FI.Security.SitemapModel>

@{
    ViewBag.Title = "Sitemap";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Styles{
    <style>
        .highlight {
            background-color: antiquewhite;
        }
    </style>

}

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            全部的菜单
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-map-marker"></i> Admin</a></li>
            <li><a href="#">Sitemap</a></li>
            <li class="active">Index</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <!-- Default box -->
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title"> </h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip"
                            title="Collapse">
                        <i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
                        <i class="fa fa-times"></i>
                    </button>
                </div>
            </div>
            <div class="box-body">
                <div class="row">
                    <table class="table" id="menus">
                        <thead>
                            <tr>
                                <th>
                                    @Html.DisplayNameFor(model => model.SitemapTitle)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.SitemapType)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.SitemapDesc)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.URL)
                                </th>

                                <th>
                                    @Html.DisplayNameFor(model => model.OrderBy)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.ShowInMenu)
                                </th>

                                <th>
                                    @Html.DisplayNameFor(model => model.Area)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Controller)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Action)
                                </th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
                            {
                                string hl = "";
                                if (item.Id == item.SitemapParent)
                                {
                                    hl = "highlight";
                                }
                                else
                                {
                                    hl = "";
                                }
                                <tr class="@hl">

                                    <td>
                                        @Html.DisplayFor(modelItem => item.SitemapTitle)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.SitemapType)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.SitemapDesc)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.URL)
                                    </td>

                                    <td>
                                        @Html.DisplayFor(modelItem => item.OrderBy)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.ShowInMenu)
                                    </td>

                                    <td>
                                        @Html.DisplayFor(modelItem => item.Area)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Controller)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Action)
                                    </td>
                                    <td>
                                        @Html.ActionLink("编辑", "Import", "Sitemap", new { SitemapID = item.Id, }, null)

                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>

            </div>
            <!-- /.box-body -->
            <div class="box-footer">

            </div>
            <!-- /.box-footer-->
        </div>
        <!-- /.box -->
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->




@section Scripts
{


    <script type="text/javascript">
        $(document).ready(function () {

            $("#menus").DataTable({
                'paging': false,
                'lengthChange': false,
                'searching': false,
                'ordering': false,
                'info': false,
                'autoWidth': false
            })
        })
    </script>

}